
*==============================================================================*
*          event study graphs tier 0 exhaust standards, 1957-1971              *
*==============================================================================*

u "replicationFiles/dataSTATA/combined/combined_aes73.dta", clear

foreach p in CO CO2 HC NOX {
	su emissions_new_`p'_noncalifornia if model_year == 1967
	replace emissions_new_`p'_noncalifornia = 100 * emissions_new_`p'_noncalifornia / r(mean)

	su emissions_new_`p'_california if model_year == 1965
	replace emissions_new_`p'_california = 100 * emissions_new_`p'_california / r(mean)
}

* panel A: federal (non california)
tw 	(connected emissions_new_CO_noncalifornia model_year) ///
	(connected emissions_new_HC_noncalifornia model_year, msym(S)) ///
	(line emissions_new_NOX_noncalifornia model_year, lpattern(dash)) ///
	(line emissions_new_CO2_noncalifornia model_year, lpattern(shortdash)), ///
	graphr(color(white)) yscale(noline) ///
	legend(order(1 "CO (regulated in 1968)" 2 "HC (regulated in 1968)" 3 "NO{sub:x} (not regulated)" 4 "CO{sub:2} (not regulated)")) ///
	xline(1967, lcolor(black)) ///
	xtit("Model Year") ///
	ytit("Emissions Rate (1967=100)") ///
	xlab(1958 1963 1968 1971) ///
	saving("results/figures/f3_evstud_tier0/federal.gph", replace)
	graph export "results/figures/f3_evstud_tier0/federal.wmf", replace
	graph export "$overleaf/figures/f3_evstud_tier0/federal.eps", replace

* panel B: california
tw 	(connected emissions_new_CO_california model_year) ///
	(connected emissions_new_HC_california model_year, msym(S)) ///
	(line emissions_new_NOX_california model_year, lpattern(dash)) ///
	(line emissions_new_CO2_california model_year, lpattern(shortdash)), ///
	graphr(color(white)) yscale(noline) ///
	legend(order(1 "CO (regulated in 1966)" 2 "HC (regulated in 1966)" 3 "NO{sub:x} (not regulated)" 4 "CO{sub:2} (not regulated)")) ///
	xline(1965, lcolor(black)) ///
	xtit("Model Year") ///
	ytit("Emissions Rate (1965=100)") ///
	xlab(1957 1961 1966 1971) ///
	saving("results/figures/f3_evstud_tier0/california.gph", replace)
	graph export "results/figures/f3_evstud_tier0/california.wmf", replace
	graph export "$overleaf/figures/f3_evstud_tier0/california.eps", replace




